<?php

class MY_Controller extends Controller {

    var $_data = FALSE;
    var $container = "container";

    function MY_Controller() {
        parent::Controller();
        $this->load->helper('form');
        $this->load->helper('url');
        $this->load->helper('date'); 
        $this->load->helper('seating_falin_helper');
        $this->load->library('pagination');
        $this->load->library('session');
        $this->load->library('form_validation');
        $this->_data['error'] ='';
    }

    function display_view($path) {
        $this->before_render();
        $this->_data['view_path'] = $path;
        $this->load->view($this->container, $this->_data);
    }
    function before_render(){

    }
}

class FrontEnd_Controller extends MY_Controller {
    function FrontEnd_Controller() {
        parent::MY_Controller();
        $header['page'] = "home/header";
        $footer['page'] = "home/footer";
        $sidebar['page'] = "home/sidebar";
        $this->load->model('Home_m');
        $this->_data['sidebar'] = $sidebar;
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
        $this->_data['page_title'] = 'Seatting Falin';
        $this->_data['login_gardient_error']=False;
        $this->_data['login_error']=False;
        $this->_data['validate_error_gardient']=False;
        $this->_data['validate_error']=False;
        $this->_data['smart_navigate_url'] = base_url();
        $this->_data['selected_region'] = FALSE;
    }
    function  before_render() {
        $this->_data['card_vip'] = $this->Home_m->get_card_vip();
        $this->_data['protect_animal'] = $this->Home_m->get_protect_animal();
        $this->_data['actualite'] = $this->Home_m->get_random_actualite();
        $this->_data['recommandation'] = $this->Home_m->get_random_recommandation();
    }
}

class Admin_Controller extends MY_Controller {
    function Admin_Controller() {
        parent::MY_Controller();
        $header['page'] = "admin/header";
        $footer['page'] = "admin/footer";
        $sidebar['page'] = "admin/sidebar";
        $this->_data['sidebar'] = $sidebar;
        $this->_data['header'] = $header;
        $this->_data['footer'] = $footer;
        $this->_data['page_title'] = 'admin';
        $this->container = 'admin/container';
    }

}
